package com.zuipin.quartz;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.zuipin.service.IEvaluationInfoService;
import com.zuipin.util.DateUtils;

import net.sf.json.JSONObject;

/**
 * 取消置顶时间超过30天的置顶标识
 *
 * @ClassName CancelTopJob
 * @author wangcongyi
 * @date 2017年7月10日 下午5:58:09
 */
@Configuration
public class CancelTopJob extends QuartzJobBean {

	@Resource
	private IEvaluationInfoService evaluationInfoService;
	private Logger log = Logger.getLogger(CancelTopJob.class);
	public static final int TOP_DAY = 30;

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		// TODO Auto-generated method stub
		log.info("取消置顶--定时器---start----"+DateUtils.getCurrentDateTime());
		JSONObject params = new JSONObject();
		params.put("day", TOP_DAY);
		evaluationInfoService.cancelTop(params);
		log.info("取消置顶--定时器---end----"+DateUtils.getCurrentDateTime());
	}

}
